﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OnlineManagement.Web.pages
{
    public partial class PigletsManagement : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack){
                BindRepeater(1001);
            }
          
        }

        //void rpPiglets_ItemDataBound(object sender, RepeaterItemEventArgs e)
        //{
        //    if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem){
        //        if(((OnlineManagement.Model.Piglets)e.Item.DataItem).CastrateDate==null){
        //            ((Label)e.Item.FindControl("lbCastrateDate")).Text = "--";
        //        }
        //    }
        //}
        private void BindRepeater(int hoggeryID) {
            BLL.Dal.Piglets pigletDll = new BLL.Dal.Piglets();
          System.Data.DataSet ds=  pigletDll.GetPigletsByHoggeryID(hoggeryID, 1, 5);
          rpPiglets.DataSource = ds;
          rpPiglets.DataBind();
        }
    }
}